home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / Keyboards.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  5.1 KB  |  200 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Keyboards.a
  3. ;
  4. ;    Contains:    Keyboard API.
  5. ;
  6. ;    Version:    Technology:    Keyboard 1.0
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__KEYBOARDS__') = 'UNDEFINED' THEN
  19. __KEYBOARDS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.  
  25. ; ——————————————————————————————————————————————————————————————————————————————————
  26. ;  Keyboard API constants                                                            
  27. ; ——————————————————————————————————————————————————————————————————————————————————
  28. ;  Keyboard API Trap Number. Should be moved to Traps.i 
  29.  
  30. _KeyboardDispatch                EQU        $AA7A
  31. ;  Gestalt selector and values for the Keyboard API 
  32.  
  33. gestaltKeyboardsAttr            EQU        'kbds'
  34. gestaltKBPS2Keyboards            EQU        1
  35. gestaltKBPS2SetIDToAny            EQU        2
  36. gestaltKBPS2SetTranslationTable    EQU        4
  37. ;  Keyboard API Error Codes 
  38.  
  39. ;   I stole the range blow from the empty space in the Allocation project but should
  40. ;   be updated to the officially registered range.
  41.  
  42.  
  43.  
  44. errKBPS2KeyboardNotAvailable    EQU        -30850
  45. errKBIlligalParameters            EQU        -30851
  46. errKBFailSettingID                EQU        -30852
  47. errKBFailSettingTranslationTable EQU    -30853
  48. errKBFailWritePreference        EQU        -30854
  49.  
  50. ;  Keyboard HW Layout Types 
  51.  
  52. kKeyboardJIS                    EQU        'JIS '
  53. kKeyboardANSI                    EQU        'ANSI'
  54. kKeyboardISO                    EQU        'ISO '
  55. kKeyboardUnknown                EQU        $3F3F3F3F
  56.  
  57. ; ——————————————————————————————————————————————————————————————————————————————————
  58. ;  Keyboard API types                                                                
  59. ; ——————————————————————————————————————————————————————————————————————————————————
  60.  
  61.  
  62.  
  63. ; ——————————————————————————————————————————————————————————————————————————————————
  64. ;  Keyboard API routines                                                            
  65. ; ——————————————————————————————————————————————————————————————————————————————————
  66.  
  67. ;
  68. ; pascal OSErr KBInitialize(void )
  69. ;
  70.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  71.         Macro
  72.         _KBInitialize
  73.             move.w              #$0000,D0
  74.             dc.w                $AA7A
  75.         EndM
  76.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  77.         IMPORT_CFM_FUNCTION KBInitialize
  78.     ENDIF
  79.  
  80. ;
  81. ; pascal OSErr KBSetupPS2Keyboard(short deviceID, char *alternativeTable)
  82. ;
  83.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  84.         Macro
  85.         _KBSetupPS2Keyboard
  86.             move.w              #$0001,D0
  87.             dc.w                $AA7A
  88.         EndM
  89.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  90.         IMPORT_CFM_FUNCTION KBSetupPS2Keyboard
  91.     ENDIF
  92.  
  93. ;
  94. ; pascal OSErr KBGetPS2KeyboardID(short *deviceID)
  95. ;
  96.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  97.         Macro
  98.         _KBGetPS2KeyboardID
  99.             move.w              #$0002,D0
  100.             dc.w                $AA7A
  101.         EndM
  102.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  103.         IMPORT_CFM_FUNCTION KBGetPS2KeyboardID
  104.     ENDIF
  105.  
  106. ;
  107. ; pascal Boolean KBIsPS2KeyboardConnected(void )
  108. ;
  109.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  110.         Macro
  111.         _KBIsPS2KeyboardConnected
  112.             move.w              #$0003,D0
  113.             dc.w                $AA7A
  114.         EndM
  115.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  116.         IMPORT_CFM_FUNCTION KBIsPS2KeyboardConnected
  117.     ENDIF
  118.  
  119. ;
  120. ; pascal Boolean KBIsPS2KeyboardEnabled(void )
  121. ;
  122.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  123.         Macro
  124.         _KBIsPS2KeyboardEnabled
  125.             move.w              #$0004,D0
  126.             dc.w                $AA7A
  127.         EndM
  128.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  129.         IMPORT_CFM_FUNCTION KBIsPS2KeyboardEnabled
  130.     ENDIF
  131.  
  132. ;
  133. ; pascal long KBGetPS2KeyboardAttributes(void )
  134. ;
  135.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  136.         Macro
  137.         _KBGetPS2KeyboardAttributes
  138.             move.w              #$0005,D0
  139.             dc.w                $AA7A
  140.         EndM
  141.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  142.         IMPORT_CFM_FUNCTION KBGetPS2KeyboardAttributes
  143.     ENDIF
  144.  
  145. ;
  146. ; pascal OSErr KBSetKCAPForPS2Keyboard(Handle kcapHandle)
  147. ;
  148.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  149.         Macro
  150.         _KBSetKCAPForPS2Keyboard
  151.             move.w              #$0006,D0
  152.             dc.w                $AA7A
  153.         EndM
  154.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION KBSetKCAPForPS2Keyboard
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal OSType KBGetLayoutType(short deviceID)
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  162.         Macro
  163.         _KBGetLayoutType
  164.             move.w              #$0007,D0
  165.             dc.w                $AA7A
  166.         EndM
  167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  168.         IMPORT_CFM_FUNCTION KBGetLayoutType
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal OSErr KBSetupPS2KeyboardFromLayoutType(OSType layoutType)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  175.         Macro
  176.         _KBSetupPS2KeyboardFromLayoutType
  177.             move.w              #$0008,D0
  178.             dc.w                $AA7A
  179.         EndM
  180.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  181.         IMPORT_CFM_FUNCTION KBSetupPS2KeyboardFromLayoutType
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal OSErr KBGetPS2KeyboardLayoutType(OSType *layoutType)
  186. ;
  187.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  188.         Macro
  189.         _KBGetPS2KeyboardLayoutType
  190.             move.w              #$0009,D0
  191.             dc.w                $AA7A
  192.         EndM
  193.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  194.         IMPORT_CFM_FUNCTION KBGetPS2KeyboardLayoutType
  195.     ENDIF
  196.  
  197.  
  198.     ENDIF ; __KEYBOARDS__ 
  199.  
  200.